
export default (app) => {
    app.directive('preventReClick', {
        mounted (el, binding) {
            let timer = null
            el.addEventListener('click', () => {
                const firstClick = !timer
                if (firstClick) {
                    binding.value()
                }
                if (timer) {
                    clearTimeout(timer)
                }
                timer = setTimeout(() => {
                    timer = null
                    if (!firstClick) {
                        // binding.value()
                    }
                }, 1000)
            })
        }
    })
}
